package com.dotflat.training.domain;

import com.dotflat.rest.domain.AreableObjectBase;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.util.Date;

@Entity
@Table(name = "ot_course_book_record", uniqueConstraints = {@UniqueConstraint(columnNames = {"areaId", "offlineCourseId", "staffId"})})
@Data
@EqualsAndHashCode(callSuper = true)
public class OTCourseBookRecord extends AreableObjectBase {

	@Column(columnDefinition = " bit(1) default 0 COMMENT '是否预约' ")
	private Boolean booked = false;

	@Column(columnDefinition = " datetime COMMENT '预约时间' ")
	private Date bookedAt = new Date();

	@Column(columnDefinition = " varchar(32)  COMMENT '线下课id'")
	private String offlineCourseId;

	@Column(columnDefinition = " varchar(32)  COMMENT '老师的id'")
	private String staffId;

	@Column(columnDefinition = " varchar(32)  COMMENT '老师的名字'")
	private String staffName;

	@Column(columnDefinition = " varchar(255)  COMMENT '上传老师头像'")
	private String staffHeadImg;

	@Column(columnDefinition = " datetime COMMENT '签到时间' ")
	private Date checkedAt = new Date();

	@Column(columnDefinition = " bit(1) default 0 COMMENT '是否签到' ")
	private Boolean checked = false;

	@Column(columnDefinition = "varchar(32)  COMMENT '签到人'")
	private String checkedBy;

//	@JsonIgnore
//	@OneToMany(fetch = FetchType.LAZY)
//	private Collection<OTCourseCheckRecord> checkRecords;
}
